package graph_viewer.structure;

import java.awt.*;
import javax.swing.*;
import java.util.*;

import graph_viewer.canvas.*;

import graph_viewer.util.Debug;

public interface Graph extends Visual_Component{

	public void		traverse( Command action );// different graph traverse different nodes collection.
	public Node		search( String node_label );

	public void		add_node( Node n );
	public void		delete_node( Node n );
	public void		delete_related_cluster_edges( Node a_node );
	public void		update_related_cluster_edges( Node a_node, Node replaced_node );
	
	public Tree		find_tree();
	public ArrayList	find_nodes();
	public ArrayList	find_edges();	// label pairs
	public ArrayList	find_psuedo_clusters( Collection a_tree_node_collection );
	public ArrayList	find_leaf_clusters();

	public ArrayList	find_displayed_nodes();

	// find the sibling clusters that have edges to this cluster. if cluster is a leaf, then return find_adjcant_nodes_in_same_cluster.
	public ArrayList	find_adjcant_clusters( Node cluster );	
	public ArrayList	find_internal_cluster_edges( Node cluster );
	public ArrayList	find_internal_cluster_psuedo_edges( Node cluster );
	public ArrayList	find_external_cluster_edges( Node cluster );
	
	public ArrayList	find_same_height_nodes( int height );
	public ArrayList	find_same_height_non_psuedo_nodes( int height );

	public boolean	is_connected( Node a_node, Node another_node );
	public int			degree( Node node );
	public int			inside_cluster_degree( Node node );
	
	//set a filtered node size
	public String		get_class_name();

	//alogithm method of template pattern
	public void allocate_DOI( Node focus_node );
	//public void reallocate_DOI( int threshold_value );

	public void do_cluster( int thresholding, Graph_Canvas graph_canvas );
	
	public void do_pre_clustering_animation( int thresholding, Graph_Canvas graph_canvas );
	public void do_post_clustering_animation( int thresholding, Graph_Canvas graph_canvas );

	
	static final public int
		DEFAULT_DOI	= 0,
		MAX_DOI		= 1,
		MIN_DOI		= Integer.MIN_VALUE;
}
